/**
 * Copyright (c) suzuki ryoutoku
 * See this code regarding the Apache License Version 2.0
 * @author suzuki ryoutoku
 */

#ifndef WRITER_H
#define WRITER_H

//=============================================================================
//	Protected multiple include file
//=============================================================================
#include "include/declare.h"
#include "Graphics.h"
using namespace std;

//=============================================================================
//	Define class
//=============================================================================
/**
 * Create pcm file from Model data.
 * @author suzuki ryoutoku
 * @version 1.0
 * @date 2008-6-23
 */
class library::graphics::Writer
{
private:
  char m_filename[1024];
public:
  Writer(const char* filename = NULL);
  bool outputPCM(library::graphics::Model* model);
  bool outputVDF(library::graphics::Model* model);

private:
  bool outputPolygonBody(ofstream& fout,library::graphics::PolygonBody* body,
						 int id);
  bool outputVertex(ofstream& fout,library::graphics::PolygonBody* body,
					int targetid);
  bool outputUV(ofstream& fout,library::graphics::PolygonBody* body,
				int targetid);
  bool outputCluster(ofstream& fout,library::graphics::PolygonBody* body,
					 int targetid);
  bool outputTextureGroup(ofstream& fout,
						  library::graphics::PolygonBody* body,
						  int targetid);
  bool outputSelectionGroup(ofstream& fout,
							library::graphics::PolygonBody* body,
							int targetid);
  
  
  
};




#endif
